// --------------------------------------------------------------------------------------------------------------------
// <copyright file="SA1101PrefixLocalCallsWithThis.cs" company="StyleCop for ReSharper Development Team">
//   Copyright (c) StyleCop for ReSharper Development Team. All rights reserved.
// </copyright>
// <summary>
//   Example file for PrefixLocalCallsWithThis.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace StyleCop.For.ReSharper.TestProject.Readability
{
    using System;

    /// <summary>
    /// Example file for PrefixLocalCallsWithThis.
    /// </summary>
    public class SA1101PrefixLocalCallsWithThis
    {
        /// <summary>
        /// My Comment for this type.
        /// </summary>
        private string mystring = string.Empty;

        /// <summary>
        /// A comment.
        /// </summary>
        private SA1101PrefixLocalCallsWithThis a;

        /// <summary>
        /// Initializes a new instance of the SA1101PrefixLocalCallsWithThis class.
        /// </summary>
        public SA1101PrefixLocalCallsWithThis()
        {
            string value = MyPrivateMethod();

            Console.WriteLine(value);
        }

        /// <summary>
        /// Gets or sets the MyString value.
        /// </summary>
        /// <value>The MyString value.</value>
        public string MyString
        {
            get
            {
                if (this.mystring != null && mystring.EndsWith("dave"))
                {
                    return "test";
                }

                return mystring;
            }

            set
            {
                mystring = value;
            }
        }

        /// <summary>
        /// A header for the init method.
        /// </summary>
        public static void Init()
        {
            a = new SA1101PrefixLocalCallsWithThis();
        }

        /// <summary>
        /// This is a sample method.
        /// </summary>
        /// <returns>
        /// Returns a sample value.
        /// </returns>
        private string MyPrivateMethod()
        {
            return "MyPrivateMethod";
        }
    }
}